<ul class="submenu">
<?php 
	$item_number = 3;
	$item_product_number = 5;
	$i = 0;
	foreach ($data as $item)
	{
		if($i<$item_number)
		{
		?>
	<div class="product_sub">
	<ul>
		<li class="top_tit"><?php echo $item['name'];?></li>
		<?php 
			$dataProduct = $model_product->getItemsByCate($item['id']);
			$i_p = 0;
			foreach ($dataProduct as $item_product)
			{
				if($i_p<$item_product_number)
				{
					echo '<li><a href="'.$baseUrl.$model_product->getLinkById($item_product['id']).'">'.$item_product['name'].'</a></li>';
				}
				$i_p++;
			}
		?>
	</ul>
	</div>
	<?php 
		}
		$i++;
	}
?>
</ul>